package org.to_zero.springboot.task.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class ScheduledService {

    @Scheduled(cron = "1-5 * 14,15 * * 6")
    public void handling() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateTime = sdf.format(new Date());
        System.out.println(dateTime + " : schedule task handling...");
    }
}
